package com.junbao.message.infrastructure.repository;

import com.junbao.commom.exception.JunBaoException;


/**
 * 定时任务开关信息 接口
 * @author yyp
 *
 */
public interface TimingTaskDao {
	
	/**
	 * 更新消息状态为死亡
	 * @param taskSwitchOne
	 * @param taskSwitchTwo
	 * @throws JunBaoException
	 */
	public Integer updateMessageToDeadTaskSwitch(String taskSwitchOne,String taskSwitchTwo) throws Exception;
	
	/**
	 * 更新待通知状态为待确认状态
	 * @param taskSwitchOne
	 * @param taskSwitchTwo
	 * @throws JunBaoException
	 */
	public Integer updateMessageToWaitConfirmTaskSwitch(String taskSwitchOne,String taskSwitchTwo) throws Exception;

	/**
	 * 向主动方发起消息状态确认
	 * @param taskSwitchOne
	 * @param taskSwitchTwo
	 * @throws JunBaoException
	 */
	public Integer updateMessageConfirmSwitch(String taskSwitchOne,String taskSwitchTwo) throws Exception;
	
	/**
	 * 向目标系统（被动方）发起消息重试
	 * @param taskSwitchOne
	 * @param taskSwitchTwo
	 * @throws JunBaoException
	 */
	public Integer updateMessageRetryTaskSwitch(String taskSwitchOne,String taskSwitchTwo) throws Exception;
	
	/**
	 * 将超过24小时的消息迁移至消息历史表
	 * @param taskSwitchOne
	 * @param taskSwitchTwo
	 * @throws JunBaoException
	 */
	public Integer updateMessageRemovalSwitch(String taskSwitchOne,String taskSwitchTwo) throws Exception;

	/**
	 * 将状态从确认中修改为待确认任务开关
	 */
	public Integer messageStatusToWaitConfirmFromConfirmingUpdateSwitch(String taskSwitchOne,String taskSwitchTwo) throws Exception;

	/**
	 * 将状态从发送中修改为待发送任务开关
	 * @throws Exception 
	 */
	public int messageStatusToWaitSendFromSendingUpdateSwitch(String switchOff, String switchOn) throws Exception;
}
